<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/static/common/inner-header.jspf"%>
<title>成绩列表</title>
<script type="text/javascript" src = "<%=request.getContextPath() %>/static/teach/js/record-list.js"></script>
<link rel="stylesheet" href="<%=request.getContextPath()%>/static/sys/user/css/user-list.css"/>
</head>
<body>
	
<form id="myform1" name="myform1" action = "<%=request.getContextPath()%>/teach/examrecords/ExamRecordsServlet?command=list" method="post">
	学员姓名：<input name = "userName"  style="width:80px;" type="text" value = "${researchInfo.userName }"></input>
	&nbsp;&nbsp;班级：<select name="className">
								<option value="">--</option>
								<c:forEach items="${researchInfo.classList }"  var="selectClass">
									<option value="${selectClass}" <c:if test="${researchInfo.className == selectClass}">selected=selected</c:if>>${selectClass}</option>
								</c:forEach>
							</select>
	&nbsp;&nbsp;试卷：<input name = "paperName"  style="width:80px;" type="text" value = "${researchInfo.paperName }"></input>
	&nbsp;&nbsp;通过情况：<select name="state">
								<option value="">--</option>
								<option value="1" <c:if test="${researchInfo.state==1}">selected=selected</c:if>>通过</option>
								<option value="2"<c:if test="${researchInfo.state==2}">selected=selected</c:if>>未通过</option>
								<option value="3" <c:if test="${researchInfo.state==3}">selected=selected</c:if>>未提交或超时</option>
							</select>
							<c:if test=""></c:if>
	&nbsp;&nbsp;分数段<input  style="width:80px;" type="text"  <c:if test="${researchInfo.startPoint !=0}">value = "${researchInfo.startPoint }" </c:if>name="startPoint">	--<input  style="width:80px;" <c:if test="${researchInfo.endPoint !=0}">value = "${researchInfo.endPoint }" </c:if>  type="text"  name="endPoint">
							<input type = "submit" value="查询" title="点击查询"></input>
</form>

<%--表格形式显示数据 --%>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="6%" height="19" valign="bottom"><div align="center"><img src="<%=request.getContextPath()%>/static/common/basic-page/images/tb.gif" width="14" height="14" /></div></td>
                <td width="94%" valign="bottom"><span class="STYLE1"> 管理人员基本信息列表</span></td>
              </tr>
            </table></td>
            <td><div align="right"><span class="STYLE1">
              <input type="checkbox" name="checkbox11" id="checkbox11" />
              全选      &nbsp;&nbsp;<a href="<%=request.getContextPath() %>/user/AllUserCommandServlet?command=toAddUser"><img src="<%=request.getContextPath()%>/static/common/basic-page/images/add.gif" width="10" height="10" /> 添加</a>   &nbsp; <img src="<%=request.getContextPath()%>/static/common/basic-page/images/del.gif" width="10" height="10" /> 删除    &nbsp;&nbsp;<img src="<%=request.getContextPath()%>/static/common/basic-page/images/edit.gif" width="10" height="10" /> 编辑   &nbsp;</span><span class="STYLE1"> &nbsp;</span></div></td>
          </tr>
        </table>
        </td>
      </tr>
    </table>
    </td>
	</tr>
	<tr>
		<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
				<thead>
					<tr>
						<th width="4%" height="20" bgcolor="d3eaef" class="STYLE10">
						<div align="center">
							<input type="checkbox" name="checkbox" id="checkbox" />
						</div>
						<td height="25" bgcolor="d3eaef" class="STYLE19"><div align="center"><span class="STYLE10">序号</span></div></td>
						<td height="25" bgcolor="d3eaef" class="STYLE19"><div align="center"><span class="STYLE10">学员名称</span></div></td>
						<td height="25" bgcolor="d3eaef" class="STYLE19"><div align="center"><span class="STYLE10">试卷名称</span></div></td>
						<td height="25" bgcolor="d3eaef" class="STYLE19"><div align="center"><span class="STYLE10">开始时间</span></div></td>
						<td height="25" bgcolor="d3eaef" class="STYLE19"><div align="center"><span class="STYLE10">提交时间</span></div></td>
						<td height="25" bgcolor="d3eaef" class="STYLE19"><div align="center"><span class="STYLE10">总分数</span></div></td>
						<td height="25" bgcolor="d3eaef" class="STYLE19"><div align="center"><span class="STYLE10">得分数</span></div></td>
						<td height="25" bgcolor="d3eaef" class="STYLE19"><div align="center"><span class="STYLE10">是否通过</span></div></td>
					</tr>
				</thead>
				<tbody>
				<c:forEach items="${pageModel.list}" var="record"  varStatus="v">
							<tr>
							<td height="25" bgcolor="#FFFFFF"><div align="center">
						          <input type="checkbox" name="checkbox4" id="checkbox4" />
						    </div></td>
							<td height="25" bgcolor="d3eaef" class="STYLE10" scope="row"> ${v.count+(pageModel.pageNo-1)*pageModel.pageSize} </td>
							<td height="25" bgcolor="d3eaef" class="STYLE10">${record.userName }</td>
							<td height="25" bgcolor="d3eaef" class="STYLE10">${record.paperName}</td>
							<td height="25" bgcolor="d3eaef" class="STYLE10"><fmt:formatDate value="${record.startTime }" pattern="yyyy-MM-dd HH:mm:ss" /></td>
							<td height="25" bgcolor="d3eaef" class="STYLE10"><fmt:formatDate value="${record.submitTime }" pattern="yyyy-MM-dd HH:mm:ss" /></td>
							<td height="25" bgcolor="d3eaef" class="STYLE10">${record.totalPoint }</td>
							<td height="25" bgcolor="d3eaef" class="STYLE10">${record.getPoint }</td>
							<td height="25" bgcolor="d3eaef" class="STYLE10"><c:if test="${record.isPass==1 }">通过</c:if><c:if test="${record.isPass==2 }">未通过</c:if><c:if test="${record.isPass==3 }">未提交或超时</c:if></td>
					</tr> 
				</c:forEach>
				<tr>
						<td colspan="9" align="right">
							<a href = "javascript:;" onclick="submitCondition(${pageModel.first});">首页</a>&nbsp;
							<a href = "javascript:;" onclick="submitCondition(${pageModel.pre});">上一页</a>&nbsp;
							第<select onchange="goPage(this)">
								<script>
									var pageNo = '${pageModel.pageNo}';
						     		var totalPage = '${pageModel.totalPage}';
									for (var i = 1; i <= totalPage; i++) {
										if (pageNo == i) {
											document.write('<option value="' + i + '" selected="selected">' + i + '</option>');
										} else {
											document.write('<option value="' + i + '">' + i + '</option>');
										}
									}
								</script>
							 </select>页
							,共${pageModel.totalPage}页&nbsp;
							<a href = "javascript:;" onclick="submitCondition(${pageModel.next});">下一页</a>&nbsp;
							<a href = "javascript:;" onclick="submitCondition(${pageModel.last});">尾页</a>&nbsp;
							共${pageModel.allRecords }条记录
						</td>
					</tr>
				</tbody>
			</table>
		</td>
	</tr>
</table>
</body>
<script type="text/javascript">
function submitCondition(pageNo){
	document.myform1.action="<%=request.getContextPath()%>/teach/examrecords/ExamRecordsServlet?command=list&pageNo="+pageNo;
	document.myform1.submit();
}

function goPage(obj){
	submitCondition(obj.value);
}
</script>
</html>
